projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94bfb9c
)
service: send ubus notifications for event triggers
author
Felix Fietkau
<
[email protected]
>
Thu, 2 Oct 2025 09:03:41 +0000
(11:03 +0200)
committer
Felix Fietkau
<
[email protected]
>
Thu, 2 Oct 2025 09:03:45 +0000
(11:03 +0200)
This makes it easier to use procd as distribution for system events
Signed-off-by: Felix Fietkau <
[email protected]
>
service/service.c
patch
|
blob
|
history
diff --git
a/service/service.c
b/service/service.c
index f40a1f184f060aa5fd2fe21195698236c086c5c0..831f075a33f0f3387cde258ad6e36b8125bafcaf 100644
(file)
--- a/
service/service.c
+++ b/
service/service.c
@@
-777,6
+777,11
@@
service_handle_event(struct ubus_context *ctx, struct ubus_object *obj,
event = blobmsg_get_string(tb[EVENT_TYPE]);
trigger_event(event, tb[EVENT_DATA]);
+ blob_buf_init(&b, 0);
+ blobmsg_add_string(&b, "type", event);
+ blobmsg_add_blob(&b, tb[EVENT_DATA]);
+ ubus_notify(ctx, &main_object, "event.trigger", b.head, -1);
+
if (!strcmp(event, "config.change")) {
struct blob_attr *tb2[__VALIDATE_MAX];